#include <util\AutomaticInstallation.au3>

Global $InstallProgramPath = "C:\Program Files\7-Zip\7zFM.exe"
Global $InstallFolder      = "C:\Program Files\7-Zip"
	
Global $SetupFile = "7z913.exe"
Global $UninstallPath = "C:\Program Files\7-Zip\Uninstall.exe"
Main($InstallProgramPath, $InstallFolder, $SetupFile, $UninstallPath)

Func InstallImpl($SetupPath) 
	Dim $Title = ""
	RunSetupFile($SetupPath)
	
	$Title = "7-Zip 9.13 beta Setup"
	WinWaitActive($Title)
	Send("!I")
	Sleep($SleepDelay)
	
	Dim $FinishButtonText = "&Finish"
	WinWaitActive($Title, $FinishButtonText)
	Send("!F")
	
	WinWaitClose($Title)

	Return True
EndFunc

Func UninstallImpl($UninstallPath)
	Dim $Title = ""
	Run($UninstallPath)

	$Title = "7-Zip 9.13 beta Uninstall"
	; Confirms unstall process
	WinWaitActive($title)
	Send("!U")
	Sleep($SleepDelay)

	Dim $FinishButtonText = "&Finish"
	WinWaitActive($Title, $FinishButtonText)
	Send("{DOWN}")
	Send("!F")
	
	Return True
EndFunc




